package com.itfreer.xjmh.temporary;


import com.itfreer.data.metadata.DataDefinitionService;
import com.itfreer.data.metadata.DictionaryDirectoryService;
import com.itfreer.data.metadata.entity.DataDefinitionEntity;
import com.itfreer.data.metadata.entity.DataDictionaryDirectoryEntity;
import com.itfreer.data.metadata.entity.DataDictionaryEntity;
import com.itfreer.form.api.PageInfo;
import com.itfreer.form.api.dictionary.DictionaryService;
import com.itfreer.xjmh.temporary.dao.TemporaryShowDao;
import com.itfreer.xjmh.temporary.entity.TemporaryAdministrationEntity;
import com.itfreer.xjmh.temporary.entity.TemporaryAirEntity;
import com.itfreer.xjmh.temporary.entity.TemporaryFloorEntity;
import com.itfreer.xjmh.temporary.entity.TemporaryPoliceEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.*;

@Component
public class TemporaryShowServiceImpl implements TemporaryShowService {

    @Autowired(required = false)
    private TemporaryShowDao showDao;



    @Override
    public List<Map<String, Object>> getShowData(Map<String, Object> where) {
        String creatTime = null;
        String airport = null;
        String adminId = null;
        if (where.get("createTime") != null && !"".equals(where.get("createTime"))) {
            creatTime = (String) where.get("createTime");
        }
        if (where.get("airport") != null && !"".equals(where.get("airport"))) {
            airport = (String) where.get("airport");
        }

        if (where.get("adminId") != null && !"".equals(where.get("adminId"))) {
            adminId = (String) where.get("adminId");
        }



        List<Map<String, Object>> list = showDao.getShowData(creatTime, airport, adminId);
        return list;
    }

    public List<Map<String, Object>> getShowDate() {
        List<Map<String, Object>> list = showDao.getShowDate();
/*        list.forEach(item->{
            item.forEach((key, value) ->{
                if (value != null) {
                    if (!"date".equals(key)){
                        item.put(key, new String((byte[])value));
                    }

                }
            });
        });*/
        return list;
    }

}
